package com.hnucm.cooklife.model;

import com.hnucm.cooklife.base.BaseModel;
import com.hnucm.cooklife.bean.db.DishDetail;
import com.hnucm.cooklife.bean.detail.DishDetailData;
import com.hnucm.cooklife.bean.uploaddish.UpRece;
import com.hnucm.cooklife.contract.uploaddish.Contract;

import io.reactivex.Observable;
import okhttp3.RequestBody;

public class UploadDishModel extends BaseModel implements Contract.IUploadDishModel {
    public UploadDishModel() {
        setCookies(false);
    }

    @Override
    public Observable<UpRece> uploadDish(RequestBody dishDetail) {
        return mApiServer.updateDish(dishDetail);
    }
//    @Override
//    public Observable<DishDetail> uploadDish(DishDetail dishDetail) {
//        return mApiServer.updateDish(dishDetail)
//                .map(dishDetailData -> {
////                    DishDetailData.DataDTO dto = dishDetailData.getData();
////                    DishDetail detail = new DishDetail();
////                    detail.dishId = dto.getDishId();
////                    detail.dishPic = dto.getDishPic();
////                    detail.dishDesc = dto.getDishDesc();
////                    detail.dishAuthor = dto.getDishAuthor();
////                    detail.originList.addAll(dto.getOriginList());
////                    detail.stepList.addAll(dto.getStepList());
////                    return detail;
//                });
//    }
}
